import { POST } from './common';

const baseApi = '/cas/auth';

const login = (data) => {
  return POST({
    url: baseApi + '/login',
    data
  });
};

const register = ({ roleName, createdBy }, data) => {
  return POST({
    url: baseApi + '/register',
    params: {
      roleName,
      createdBy
    },
    data
  });
}

const authoriseShop = ({ code, version }) => {
  return POST({
    url: '/cas/tiktok/code',
    params: { code, version }
  });
};

export default {
  login,
  register,
  authoriseShop
}
